import {
	request_post
} from './respones.js'

// 我的页面
export const getUserInfo = (openid) => {
	return request_post('/yunyou_login', {
		'open_id': openid
	})
}

// 获取待使用API
export const getNoUse = (openid) => {
	return request_post("/to_be_used", {
		'open_id': openid
	})
}

// 退款api
export const tuikuanFunction = (id) => {
	return request_post("/cancel_reservation", {
		'id': id
	})
}

// 获取微信记录支付列表
export const getPayHistoryList = (openid) => {
	return request_post('/search_booking_consumption', {
		"open_id": openid
	})
}

// 用户上传 （不包含图片）
export const userInfoUploadFile = (name, openid) => {
	return request_post('/yunyou_edit', {
		'tou_xiang': "False",
		'name': name,
		'open_id': openid
	})
}

// 创建组队
export const zuduiDating = (data) => {
	return request_post('/create_pipei_team', {
		'team_name': data.name,
		'duiyou_shuliang': data.shuliang,
		'open_id': data.openid,
		'yuyue_id': data.yuyueid,
		'start_time': data.start,
		'end_time': data.end,
		'is_huihua':data.is_huihua
	})
}

// 队伍 搜索
export const jiaruDuiwu = (data) => {
	return request_post('/search_pipei_team', {
		'open_id': data.openid,
		'lat': data.longitude,
		'lon': data.latitude,
		'distance': data.distance
	})
}

// 获取组队
export const getZuDui = (id) => {
	return request_post('/one_pipei_team', {
		'pipei_id': id
	})
}

// 加入队伍
export const joinDuiwu = (data) => {
	return request_post('/join_pipei_team', {
		'start_time': data.start,
		'end_time': data.end,
		'id': data.id,
		'open_id': data.openId
	})
}

// 获取正在匹配的组队
export const getUserHistoryPipayList = (id) => {
	return request_post('/my_pipei_team', {
		'open_id': id
	})
}

// 退出组队 
export const exitUserTeam = (id, openid) => {
	return request_post('/exit_the_team', {
		'id': id,
		'open_id': openid
	})
}

// 踢出队友
export const exitTeamUser = (id, duiyouid) => {
	return request_post('/kick_it_out', {
		'id': id,
		'duiyou_id': duiyouid
	})
}

// 获取历史组队
export const getUserHistory = (id) => {
	return request_post('/history_pipei_team', {
		'open_id': id
	})
}

// 实名认证
export const getShiming = (data) => {
	return request_post('/authentication', {
		'open_id': data.openid,
		'id_number':data.shenfenzheng,
		'cert_type':data.leixing,
		'name':data.name
	})
}

// 判断是不是用户
export const getIsUser = (id) => {
	return request_post('/is_user', {
		'open_id':id
	})
}

// 判断有没有实名
export const checkUserShiming = (id) =>{ 
	return request_post('/is_shimign',{
		'open_id':id
	})
}